/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.phone.entity;

import com.alibaba.druid.proxy.jdbc.JdbcParameter;
import org.hibernate.validator.constraints.Length;
import java.util.Date;
import java.util.List;

import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 商品Entity
 * @author lzw
 * @version 2019-04-03
 */
@Table(name="phone_commodity", alias="a", columns={
		@Column(name="id", attrName="id", label="id", isPK=true,isInsert = false),
		@Column(name="product_manufacturer", attrName="productManufacturer", label="产品厂商"),
		@Column(name="commodity_name", attrName="commodityName", label="商品名称", queryType=QueryType.LIKE),
		@Column(name="sytle_number", attrName="sytleNumber", label="型号-款号"),
		@Column(name="price", attrName="price", label="单价"),
		@Column(name="number", attrName="number", label="数量"),
		@Column(name="total_price", attrName="totalPrice", label="总金额"),
		@Column(name="purchase_time", attrName="purchaseTime", label="进货日期"),
		@Column(name="salesman_code", attrName="salesmanCode", label="业务员编号"),
	},joinTable = {
		@JoinTable(type=Type.LEFT_JOIN,entity=Manufacturer.class,attrName="manufacturer",alias="m",
				on="a.product_manufacturer=m.id",columns={
				@Column(name="id",label="id", isPK=true),
				@Column(name="name",  label="name",isQuery=false),
		})
	}, orderBy="a.id DESC"
)
public class PhoneCommodity extends DataEntity<PhoneCommodity> {
	
	private static final long serialVersionUID = 1L;
	private String productManufacturer;		// 产品厂商
	private String commodityName;		// 商品名称
	private String sytleNumber;		// 型号-款号
	private Double price;		// 单价
	private Long number;		// 数量
	private Double totalPrice;		// 总金额
	private Date purchaseTime;		// 进货日期
	private Long salesmanCode;		// 业务员编号
	private Manufacturer manufacturer;  //厂商
	private List<Manufacturer> manufacturerList;  //厂商列表
	private List<Staff> staffList;
	private String months; //月
	private String  quarters; //季度
	private String yrars; //年
	private String productManufacturerId;

	public String getProductManufacturerId() {
		return productManufacturerId;
	}

	public void setProductManufacturerId(String productManufacturerId) {
		this.productManufacturerId = productManufacturerId;
	}

	public String getMonths() {
		return months;
	}

	public void setMonths(String months) {
		this.months = months;
	}

	public String getQuarters() {
		return quarters;
	}

	public void setQuarters(String quarters) {
		this.quarters = quarters;
	}

	public String getYrars() {
		return yrars;
	}

	public void setYrars(String yrars) {
		this.yrars = yrars;
	}

	public List<Staff> getStaffList() {
		return staffList;
	}

	public void setStaffList(List<Staff> staffList) {
		this.staffList = staffList;
	}

	public Manufacturer getManufacturer() {
		return manufacturer;
	}

	public void setManufacturer(Manufacturer manufacturer) {
		this.manufacturer = manufacturer;
	}

	public List<Manufacturer> getManufacturerList() {
		return manufacturerList;
	}

	public void setManufacturerList(List<Manufacturer> manufacturerList) {
		this.manufacturerList = manufacturerList;
	}

	public PhoneCommodity() {
		this(null);
	}

	public PhoneCommodity(String id){
		super(id);
	}
	
	@Length(min=0, max=20, message="产品厂商长度不能超过 20 个字符")
	public String getProductManufacturer() {
		return productManufacturer;
	}

	public void setProductManufacturer(String productManufacturer) {
		this.productManufacturer = productManufacturer;
	}
	
	@Length(min=0, max=20, message="商品名称长度不能超过 20 个字符")
	public String getCommodityName() {
		return commodityName;
	}

	public void setCommodityName(String commodityName) {
		this.commodityName = commodityName;
	}
	
	@Length(min=0, max=20, message="型号-款号长度不能超过 20 个字符")
	public String getSytleNumber() {
		return sytleNumber;
	}

	public void setSytleNumber(String sytleNumber) {
		this.sytleNumber = sytleNumber;
	}
	
	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}
	
	public Long getNumber() {
		return number;
	}

	public void setNumber(Long number) {
		this.number = number;
	}
	
	public Double getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(Double totalPrice) {
		this.totalPrice = totalPrice;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd ")
	public Date getPurchaseTime() {
		return purchaseTime;
	}

	public void setPurchaseTime(Date purchaseTime) {
		this.purchaseTime = purchaseTime;
	}
	
	public Long getSalesmanCode() {
		return salesmanCode;
	}

	public void setSalesmanCode(Long salesmanCode) {
		this.salesmanCode = salesmanCode;
	}
	
}